<template>
	<div>
		<input type="text" ref="mybox" class="ipt" name="" v-model="titleVal" placeholder="会议标题" />
		<input type="text" ref="mybox" class="ipt" name="" v-model="roomIdVal" placeholder="会议室ID" />
		<input type="text" ref="mybox" class="ipt" name="" v-model="startTimeVal" placeholder="会议开始时间" />
		<input type="text" ref="mybox" class="ipt" name="" v-model="endTimeVal" placeholder="会议结束时间" />
		<input type="text" ref="mybox" class="ipt" name="" v-model="longTimeVal" placeholder="会议时长" />
		<input type="text" ref="mybox" class="ipt" name="" v-model="userVal" placeholder="会议人员" />
		<button class="btn" @click="handleBtnClick">点击预约</button>
	</div>
</template>

<script>
import axios from 'axios'
export default{
	name: "AddMeeting",
	data (){
		return {
			addList: [],
			titleVal: "",
			roomIdVal: "",
			startTimeVal: "",
			endTimeVal: "",
			longTimeVal: "",
			userVal: ""
		}
	},
	methods: {
		handleBtnClick: function(){
			this.addList.push(this.titleVal);
			this.addList.push(this.roomIdVal);
			this.addList.push(this.startTimeVal);
			this.addList.push(this.endTimeVal);
			this.addList.push(this.longTimeVal);
			this.addList.push(this.userVal);
			this.bus.$emit('change', this.addList);
			axios.post('http://office.wtcxl.cn/meeting/add',{
				theme: this.titleVal,
				meeting_room_id: this.roomIdVal,
				start_time : this.startTimeVal,
				end_time: this.endTimeVal,
				meeting_long: this.longTimeVal,
				join_user : this.userVal
			})
			.then(function (response) { 			
				console.log(response.data.code + response.data.msg);
			})
			.catch(function (error) { console.log("123"+error) });
			this.titleVal = "";
			this.roomIdVal = "";
			this.startTimeVal = "";
			this.endTimeVal = "";
			this.longTimeVal = "";
			this.userVal = "";
		},
		
	}
}

</script>

<style lang="stylus" scoped>
	@import '~styles/mixins.styl'
	.ipt 
		display block
		margin .3rem auto 0
		padding 0 0 0 .2rem
		width 90%
		height .8rem
		line-height .8rem
		border .01rem solid #ff9300
		border-radius .06rem
		box-sizing border-box
	.btn 
		display block
		margin 0.2rem auto
		padding 0 0.2rem
		width 50%
		line-height .8rem
		border-radius .1rem
		background #ff9300
		color #fff
		text-align center
</style>